<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.core.orm.hibernate.SpringSecurityUtils"%>
<%@ include file="/common/taglibs.jsp" %>
<%@ taglib prefix="s" uri="/struts-tags"  %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    
    <title>欢迎光临</title>
	 <script>
     function aa(a)
     {
       document.getElementById("pageNo").value=a;
       document.forms[0].submit();
     }
    </script>
  </head>
  
  <body> 
    欢迎光临 首页<% 
    if(SpringSecurityUtils.getCurrentUserName().equals("")||SpringSecurityUtils.getCurrentUserName().equals("roleAnonymous"))
    {%><a href="${ctx}/index/index/login.htm">登录</a>
    <%}else { 
    out.print("当前用户:"+SpringSecurityUtils.getCurrentUserName());
    %>
    <a href="${ctx}/user/users.htm">进入后台</a>
    <a href="${ctx}/j_spring_security_logout">退出登录</a>
    <%} %>
    <br>
    <center>文章列表<form action="${ctx}/index/index/search.htm" method="post"><input type="text" value="${search}" name="search" />
    <input type="hidden" name="pageNo" id="pageNo" value="${pageNo}"/>
    <input type="submit" value="查询"/></form></center>
    </hr>
   <c:forEach var="xx" items="${ariticlePage.result}">
   <a target="_blank" href="${ctx}/ariticle/ariticle.htm?id=${xx.id}">${xx.title}</a>
   <div style="border-bottom:#993310 1px dashed; height:3px;  width:50%;text-align:left;"></div> 
   </c:forEach>
   <div>
    <div id="footer" style="margin-top:10px">
	第${ariticlePage.pageNo}页, 共${ariticlePage.totalPages}页 
	<a href="javascript:aa(1)" >首页</a>
	<s:if test="ariticlePage.hasPre">
		<a href="javascript:aa(${ariticlePage.pageNo-1})" >上一页</a>
	</s:if>
	<s:if test="ariticlePage.hasNext">
		<a href="javascript:aa(${ariticlePage.pageNo+1})">下一页</a>
	</s:if>
	<a href="javascript:aa(${ariticlePage.totalPages})" >末页</a>
</div>
   </div>
  </body>
</html>
